﻿using System.Windows;
using System.Collections.Generic;
using FireFly;

namespace XAMLStylePad.ViewModels.TriggersAndSetters
{
    
    public class SetterCollectionViewModel : CollectionViewModel<SetterBase, ISetterViewModel>
    {
        // ...cause several classes uses this type of collection...
        public SetterCollectionViewModel(IList<SetterBase> list)
            : base(list,
            setter =>
            {
                if(setter is Setter)
                    return new SetterViewModel(setter as Setter);
                else if(setter is EventSetter)
                    return new EventSetterViewModel(setter as EventSetter);
                else
                    return null;
            })
        {
        }
    }
}